home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7964 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  57 lines

  1. Path: newsfeed.internetmci.com!gatech!ncar!noao!stsci!usenet
  2. From: Scott Stallcup <stallcup@stsci.edu>
  3. Newsgroups: comp.lang.c++,comp.lang.fortran
  4. Subject: Calling C++ from FORTRAN on VMS
  5. Date: Thu, 15 Feb 1996 15:52:39 -0500
  6. Organization: Space Telescope Science Institiute
  7. Message-ID: <31239D17.3159@stsci.edu>
  8. NNTP-Posting-Host: empire.stsci.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (X11; I; SunOS 5.4 sun4m)
  13. CC: stallcup@stsci.edu
  14.  
  15. I need to call a C++ routine from a FORTRAN routine on both
  16. VAX/VMS and AXP/VMS platforms.   
  17.  
  18. The C++ documentation fails to mention mixed langage programs 
  19. (other than calling C from C++)...
  20.  
  21. Given the following example code, what compiler/linker options
  22. will resolve the c++ reference ?
  23.  
  24. ---------------------------------------------------------------
  25.       program tfor
  26. c
  27.       call tcxx ()
  28. c
  29.       end
  30. ---------------------------------------------------------------
  31.  
  32. #include <stdio.h>
  33.  
  34. void tcxx (void)
  35.  {
  36.   printf ("Hello World\n");
  37.  }
  38.  
  39. ---------------------------------------------------------------
  40. $ fortran tfor
  41. $ cxx tcxx
  42. $ link tfor,tcxx
  43. %LINK-W-NUDFSYMS, 1 undefined symbol:
  44. %LINK-I-UDFSYM,         TCXX 
  45. %LINK-W-USEUNDEF, undefined symbol TCXX referenced
  46.         in psect $LINK$ offset %X00000020
  47.         in module TFOR 
  48.  
  49. ---------------------------------------------------------------
  50.  
  51. Thanks,
  52.  
  53. --------------------------------------
  54. Scott Stallcup  (stallcup@stsci.edu)
  55. Space Telescope Science Institute
  56.